home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 August: Tool Chest / Dev.CD Aug 94.toast / Sample Code / MoreFiles 1.1.1 / MoreFiles.p < prev    next >
Encoding:
Text File  |  1994-01-22  |  23.9 KB  |  642 lines  |  [TEXT/PJMM]

  1. UNIT MoreFiles;
  2.  
  3.  
  4. {    Apple Macintosh Developer Technical Support                                }
  5. {                                                                            }
  6. {    The long lost high-level and FSSpec File Manager functions.                }
  7. {    by Jim Luther, Apple Developer Technical Support                        }
  8. {                                                                            }
  9. {    File:        MoreFiles.p                                                    }
  10. {                                                                            }
  11. {    Copyright © 1992-1994 Apple Computer, Inc.                                }
  12. {    All rights reserved.                                                    }
  13. {                                                                            }
  14. {    You may incorporate this sample code into your applications without        }
  15. {    restriction, though the sample code has been provided "AS IS" and the    }
  16. {    responsibility for its operation is 100% yours.  However, what you are    }
  17. {    not permitted to do is to redistribute the source as "DSC Sample Code"    }
  18. {    after having made changes. If you're going to re-distribute the source,    }
  19. {    we require that you make it clear in the source that the code was        }
  20. {    descended from Apple Sample Code, but that you've made changes.            }
  21.  
  22.  
  23. INTERFACE
  24.  
  25. {***************************************************************************}
  26.  
  27.  
  28.     FUNCTION HGetVolParms (volName: StringPtr;
  29.                                     vRefNum: Integer;
  30.                                     VAR volParmsInfo: GetVolParmsInfoBuffer;
  31.                                     VAR infoSize: LongInt): OSErr;
  32. {    Use HGetVolParms to determine the characteristics of a volume.            }
  33. {    A result of paramErr usually just means the volume doesn't                }
  34. {    support PBHGetVolParms and the feature you were going to check            }
  35. {    for isn't available.                                                    }
  36. {                                                                            }
  37. {    volName            input:    A pointer to the name of a mounted volume        }
  38. {                            or nil.                                            }
  39. {    vRefNum            input:    Volume specification.                            }
  40. {    volParmsInfo    input:    Pointer to GetVolParmsInfoBuffer where the        }
  41. {                            volume attributes information is returned.        }
  42. {                    output:    Atributes information.                            }
  43. {    infoSize        input:    Size of buffer pointed to by volParmsInfo.        }
  44. {                    output: Size of data actually returned.                    }
  45.  
  46.  
  47. {***************************************************************************}
  48.  
  49.  
  50.     FUNCTION HCreateMinimum (vRefNum: Integer;
  51.                                     dirID: LongInt;
  52.                                     fileName: Str255): OSErr;
  53. {    Use HCreateMinimum to create a new file without attempting to set the    }
  54. {    creator and file type of the new file.  This function is needed to        }
  55. {    create a file in an AppleShare "drop box" where the user can make        }
  56. {    changes, but cannot see folder or files.                                }
  57. {                                                                            }
  58. {    vRefNum        input:    Volume specification.                                }
  59. {    dirID        input:    Directory ID.                                        }
  60. {    fileName    input:    The name of the new file.                            }
  61.  
  62.  
  63. {***************************************************************************}
  64.  
  65.  
  66.     FUNCTION FSpCreateMinimum (spec: FSSpec): OSErr;
  67. {    Use FSpCreateMinimum to create a new file without attempting to set        }
  68. {    the creator and file type of the new file.  This function is needed to    }
  69. {    create a file in an AppleShare "dropbox" where the user can make        }
  70. {    changes, but cannot see folder or files.                                }
  71. {                                                                            }
  72. {    spec        input:    An FSSpec record specifying the file to create.        }
  73.  
  74.  
  75. {***************************************************************************}
  76.  
  77.  
  78.     FUNCTION ExchangeFiles (vRefNum: Integer;
  79.                                     srcDirID: LongInt;
  80.                                     srcName: Str255;
  81.                                     dstDirID: LongInt;
  82.                                     dstName: Str255): OSErr;
  83. {    Use ExchangeFiles to exchange the data stored in two files on the        }
  84. {    same volume.                                                            }
  85. {                                                                            }
  86. {    vRefNum        input:    Volume specification.                                }
  87. {    srcDirID    input:    Source directory ID.                                }
  88. {    srcName        input:    Source file name.                                    }
  89. {    dstDirID    input:    Destination directory ID.                            }
  90. {    dstName        input:    Destination file name.                                }
  91.  
  92.  
  93. {***************************************************************************}
  94.  
  95.  
  96.     FUNCTION ResolveFileIDRef (volName: StringPtr;
  97.                                     vRefNum: Integer;
  98.                                     fileID: LongInt;
  99.                                     VAR parID: LongInt;
  100.                                     fileName: StringPtr): OSErr;
  101. {    Use ResolveFileIDRef to retrieve the filename and parent directory ID    }
  102. {    of the file with the specified file ID.                                    }
  103. {                                                                            }
  104. {    volName    input:    A pointer to the name of a mounted volume                }
  105. {                    or nil.                                                    }
  106. {    fileID    input:    The file ID.                                            }
  107. {    vRefNum    input:    Volume specification.                                    }
  108. {    parID    output:    The parent directory ID of the file.                    }
  109. {    name    input:    Points to a buffer (minimum Str63) where the filename    }
  110. {                    is to be returned or must be nil.                        }
  111. {            output:    The filename.                                            }
  112.  
  113.  
  114. {***************************************************************************}
  115.  
  116.  
  117.     FUNCTION CreateFileIDRef (vRefNum: Integer;
  118.                                     parID: LongInt;
  119.                                     fileName: Str255;
  120.                                     VAR fileID: LongInt): OSErr;
  121. {    Use CreateFileIDRef to establish a file ID for a file.                    }
  122. {                                                                            }
  123. {    vRefNum        input:    Volume specification.                                }
  124. {    parID        input:    Directory ID.                                        }
  125. {    fileName    input:    The name of the file.                                }
  126. {    fileID        output:    The file ID.                                        }
  127.  
  128.  
  129. {***************************************************************************}
  130.  
  131.  
  132.     FUNCTION FSpCreateFileIDRef (spec: FSSpec;
  133.                                     VAR fileID: LongInt): OSErr;
  134. {    Use FSpCreateFileIDRef to establish a file ID for a file.                }
  135. {                                                                            }
  136. {    spec        input:    An FSSpec record specifying the file.                }
  137. {    fileID        output:    The file ID.                                        }
  138.  
  139.  
  140. {***************************************************************************}
  141.  
  142.  
  143.     FUNCTION DeleteFileIDRef (volName: StringPtr;
  144.                                     vRefNum: Integer;
  145.                                     fileID: LongInt): OSErr;
  146. {    Use DeleteFileIDRef to delete a file ID reference.                        }
  147. {                                                                            }
  148. {    volName    input:    A pointer to the name of a mounted volume                }
  149. {                    or nil.                                                    }
  150. {    vRefNum    input:    Volume specification.                                    }
  151. {    fileID    input:    The file ID.                                            }
  152.  
  153.  
  154. {***************************************************************************}
  155.  
  156.  
  157.     FUNCTION FlushFile (refNum: Integer): OSErr;
  158. {    Use FlushFile to write the contents of a file's access path buffer.        }
  159. {                                                                            }
  160. {    refNum    input:    The file reference number of an open file.                }
  161.  
  162.  
  163. {***************************************************************************}
  164.  
  165.  
  166.     FUNCTION LockRange (refNum: Integer;
  167.                                     rangeLength: LongInt;
  168.                                     rangeStart: LongInt): OSErr;
  169. {    Use LockRange to lock a portion of a file.                                }
  170. {                                                                            }
  171. {    refNum        input:    The file reference number of an open file.            }
  172. {    rangeLength    input:    The number of bytes in the range.                    }
  173. {    rangeStart    input:    The starting byte in the range to lock.                }
  174.  
  175.  
  176. {***************************************************************************}
  177.  
  178.  
  179.     FUNCTION UnlockRange (refNum: Integer;
  180.                                     rangeLength: LongInt;
  181.                                     rangeStart: LongInt): OSErr;
  182. {    Use UnlockRange to unlock a previously locked range.                    }
  183. {                                                                            }
  184. {    refNum        input:    The file reference number of an open file.            }
  185. {    rangeLength    input:    The number of bytes in the range.                    }
  186. {    rangeStart    input:    The starting byte in the range to unlock.            }
  187.  
  188.  
  189. {***************************************************************************}
  190.  
  191.  
  192.     FUNCTION GetForeignPrivs (vRefNum: Integer;
  193.                                     dirID: LongInt;
  194.                                     name: StringPtr;
  195.                                     foreignPrivBuffer: Ptr;
  196.                                     VAR foreignPrivSize: LongInt;
  197.                                     VAR foreignPrivInfo1: LongInt;
  198.                                     VAR foreignPrivInfo2: LongInt;
  199.                                     VAR foreignPrivInfo3: LongInt;
  200.                                     VAR foreignPrivInfo4: LongInt): OSErr;
  201. {    Use GetForeignPrivs to determine the native access-control                }
  202. {    information for a file or directory stored on a volume managed by        }
  203. {    a foreign file system.                                                    }
  204. {                                                                            }
  205. {    vRefNum                input:    Volume specification.                        }
  206. {    dirID                input:    Directory ID.                                }
  207. {    name                input:    Pointer to object name, or nil when dirID    }
  208. {                                specifies a directory that's the object.    }
  209. {    foreignPrivBuffer    input:    Pointer to buffer where the privilege        }
  210. {                                information is returned.                    }
  211. {                        output:    Privilege information.                        }
  212. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  213. {                                foreignPrivBuffer.                            }
  214. {                        output: Amount of buffer actually used.                }
  215. {    foreignPrivInfo1    output:    Information specific to privilege model.    }
  216. {    foreignPrivInfo2    output:    Information specific to privilege model.    }
  217. {    foreignPrivInfo3    output:    Information specific to privilege model.    }
  218. {    foreignPrivInfo4    output:    Information specific to privilege model.    }
  219.  
  220.  
  221. {***************************************************************************}
  222.  
  223.  
  224.     FUNCTION FSpGetForeignPrivs (spec: FSSpec;
  225.                                     foreignPrivBuffer: Ptr;
  226.                                     VAR foreignPrivSize: LongInt;
  227.                                     VAR foreignPrivInfo1: LongInt;
  228.                                     VAR foreignPrivInfo2: LongInt;
  229.                                     VAR foreignPrivInfo3: LongInt;
  230.                                     VAR foreignPrivInfo4: LongInt): OSErr;
  231. {    Use FSpGetForeignPrivs to determine the native access-control            }
  232. {    information for a file or directory stored on a volume managed by        }
  233. {    a foreign file system.                                                    }
  234. {                                                                            }
  235. {    spec                input:    An FSSpec record specifying the object.        }
  236. {    foreignPrivBuffer    input:    Pointer to buffer where the privilege        }
  237. {                                information is returned.                    }
  238. {                        output:    Privilege information.                        }
  239. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  240. {                                foreignPrivBuffer.                            }
  241. {                        output: Amount of buffer actually used.                }
  242. {    foreignPrivInfo1    output:    Information specific to privilege model.    }
  243. {    foreignPrivInfo2    output:    Information specific to privilege model.    }
  244. {    foreignPrivInfo3    output:    Information specific to privilege model.    }
  245. {    foreignPrivInfo4    output:    Information specific to privilege model.    }
  246.  
  247.  
  248.  
  249. {***************************************************************************}
  250.  
  251.  
  252.     FUNCTION SetForeignPrivs (vRefNum: Integer;
  253.                                     dirID: LongInt;
  254.                                     name: StringPtr;
  255.                                     foreignPrivBuffer: Ptr;
  256.                                     VAR foreignPrivSize: LongInt;
  257.                                     foreignPrivInfo1: LongInt;
  258.                                     foreignPrivInfo2: LongInt;
  259.                                     foreignPrivInfo3: LongInt;
  260.                                     foreignPrivInfo4: LongInt): OSErr;
  261. {    Use SetForeignPrivs to change the native access-control information        }
  262. {    for a file or directory stored on a volume managed by a foreign            }
  263. {    file system.                                                            }
  264. {                                                                            }
  265. {    vRefNum                input:    Volume specification.                        }
  266. {    dirID                input:    Directory ID.                                }
  267. {    name                input:    Pointer to object name, or nil when dirID    }
  268. {                                specifies a directory that's the object.    }
  269. {    foreignPrivBuffer    input:    Pointer to privilege information buffer.    }
  270. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  271. {                                foreignPrivBuffer.                            }
  272. {                        output: Amount of buffer actually used.                }
  273. {    foreignPrivInfo1    input:    Information specific to privilege model.    }
  274. {    foreignPrivInfo2    input:    Information specific to privilege model.    }
  275. {    foreignPrivInfo3    input:    Information specific to privilege model.    }
  276. {    foreignPrivInfo4    input:    Information specific to privilege model.    }
  277.  
  278.  
  279. {***************************************************************************}
  280.  
  281.  
  282.     FUNCTION FSpSetForeignPrivs (spec: FSSpec;
  283.                                     foreignPrivBuffer: Ptr;
  284.                                     VAR foreignPrivSize: LongInt;
  285.                                     foreignPrivInfo1: LongInt;
  286.                                     foreignPrivInfo2: LongInt;
  287.                                     foreignPrivInfo3: LongInt;
  288.                                     foreignPrivInfo4: LongInt): OSErr;
  289. {    Use FSpSetForeignPrivs to change the native access-control information    }
  290. {    for a file or directory stored on a volume managed by a foreign            }
  291. {    file system.                                                            }
  292. {                                                                            }
  293. {    spec                input:    An FSSpec record specifying the object.        }
  294. {    foreignPrivBuffer    input:    Pointer to privilege information buffer.    }
  295. {    foreignPrivSize        input:    Size of buffer pointed to by                }
  296. {                                foreignPrivBuffer.                            }
  297. {                        output: Amount of buffer actually used.                }
  298. {    foreignPrivInfo1    input:    Information specific to privilege model.    }
  299. {    foreignPrivInfo2    input:    Information specific to privilege model.    }
  300. {    foreignPrivInfo3    input:    Information specific to privilege model.    }
  301. {    foreignPrivInfo4    input:    Information specific to privilege model.    }
  302.  
  303.  
  304. {***************************************************************************}
  305.  
  306.  
  307.     FUNCTION HGetLogInInfo (volName: StringPtr;
  308.                                     vRefNum: Integer;
  309.                                     VAR loginMethod: Integer;
  310.                                     userName: StringPtr): OSErr;
  311. {    Use HGetLogInInfo to determine the login method and user name used to    }
  312. {    log on to a particular shared volume.                                    }
  313. {                                                                            }
  314. {    volName        input:    A pointer to the name of a mounted volume            }
  315. {                        or nil.                                                }
  316. {    vRefNum        input:    The volume reference number.                        }
  317. {    loginMethod    output:    The login method used (kNoUserAuthentication,        }
  318. {                        kPassword, kEncryptPassword, or                        }
  319. {                        kTwoWayEncryptPassword).                            }
  320. {    userName    input:    Points to a buffer (minimum Str31) where the user    }
  321. {                        name is to be returned or must be nil.                }
  322. {                output:    The user name.                                        }
  323.  
  324.  
  325. {***************************************************************************}
  326.  
  327.  
  328.     FUNCTION HGetDirAccess (vRefNum: Integer;
  329.                                     dirID: LongInt;
  330.                                     name: StringPtr;
  331.                                     VAR ownerID: LongInt;
  332.                                     VAR groupID: LongInt;
  333.                                     VAR accessRights: LongInt): OSErr;
  334. {    Use HGetDirAccess to get the directory access control information for    }
  335. {    a directory on a shared volume.                                            }
  336. {                                                                            }
  337. {    vRefNum            input:    Volume specification.                            }
  338. {    dirID            input:    Directory ID.                                    }
  339. {    name            input:    Pointer to directory name, or nil if dirID        }
  340. {                            specifies the directory.                        }
  341. {    ownerID            output:    The directory's owner ID.                        }
  342. {    groupID            output:    The directory's group ID or                        }
  343. {                            0 if no group affiliation.                        }
  344. {    accessRights    output:    The directory's access rights.                    }
  345.  
  346.  
  347. {***************************************************************************}
  348.  
  349.  
  350.     FUNCTION FSpGetDirAccess (spec: FSSpec;
  351.                                     VAR ownerID: LongInt;
  352.                                     VAR groupID: LongInt;
  353.                                     VAR accessRights: LongInt): OSErr;
  354. {    Use FSpGetDirAccess to get the directory access control information        }
  355. {    for a directory on a shared volume.                                        }
  356. {                                                                            }
  357. {    spec            input:    An FSSpec record specifying the directory.        }
  358. {    ownerID            output:    The directory's owner ID.                        }
  359. {    groupID            output:    The directory's group ID or                        }
  360. {                            0 if no group affiliation.                        }
  361. {    accessRights    output:    The directory's access rights.                    }
  362.  
  363.  
  364. {***************************************************************************}
  365.  
  366.  
  367.     FUNCTION HSetDirAccess (vRefNum: Integer;
  368.                                     dirID: LongInt;
  369.                                     name: StringPtr;
  370.                                     ownerID: LongInt;
  371.                                     groupID: LongInt;
  372.                                     accessRights: LongInt): OSErr;
  373. {    Use HSetDirAccess to change the directory access control information    }
  374. {    for a directory on a shared volume.                                        }
  375. {                                                                            }
  376. {    vRefNum            input:    Volume specification.                            }
  377. {    dirID            input:    Directory ID.                                    }
  378. {    name            input:    Pointer to directory name, or nil if dirID        }
  379. {                            specifies the directory.                        }
  380. {    ownerID            output:    The directory's owner ID.                        }
  381. {    groupID            output:    The directory's group ID or                        }
  382. {                            0 if no group affiliation.                        }
  383. {    accessRights    output:    The directory's access rights.                    }
  384.  
  385.  
  386. {***************************************************************************}
  387.  
  388.  
  389.     FUNCTION FSpSetDirAccess (spec: FSSpec;
  390.                                     ownerID: LongInt;
  391.                                     groupID: LongInt;
  392.                                     accessRights: LongInt): OSErr;
  393. {    Use FSpSetDirAccess to change the directory access control information    }
  394. {    for a directory on a shared volume.                                        }
  395. {                                                                            }
  396. {    spec            input:    An FSSpec record specifying the directory.        }
  397. {    ownerID            output:    The directory's owner ID.                        }
  398. {    groupID            output:    The directory's group ID or                        }
  399. {                            0 if no group affiliation.                        }
  400. {    accessRights    output:    The directory's access rights.                    }
  401.  
  402.  
  403. {***************************************************************************}
  404.  
  405.  
  406.     FUNCTION HMapID (volName: StringPtr;
  407.                                     vRefNum: Integer;
  408.                                     ID: LongInt;
  409.                                     objType: Integer;
  410.                                     name: StringPtr): OSErr;
  411. {    Use HMapID to determine the name of a user or group if you know the        }
  412. {    user or group ID.                                                        }
  413. {                                                                            }
  414. {    volName        input:    A pointer to the name of a mounted volume            }
  415. {                        or nil.                                                }
  416. {    vRefNum        input:    Volume specification.                                }
  417. {    objType        input:    The mapping function code: 1 if you're mapping a    }
  418. {                        user ID to a user name or 2 if you're mapping a        }
  419. {                        group ID to a group name.                            }
  420. {    name        input:    Points to a buffer (minimum Str31) where the user    }
  421. {                        or group name is to be returned or must be nil.        }
  422. {                output:    The user or group name.                                }
  423.  
  424.  
  425. {***************************************************************************}
  426.  
  427.  
  428.     FUNCTION HMapName (volName: StringPtr;
  429.                                     vRefNum: Integer;
  430.                                     name: Str255;
  431.                                     objType: Integer;
  432.                                     VAR ID: LongInt): OSErr;
  433. {    Use HMapName to determine the user or group ID if you know the user or    }
  434. {    group name.                                                                }
  435. {                                                                            }
  436. {    volName        input:    A pointer to the name of a mounted volume            }
  437. {                        or nil.                                                }
  438. {    vRefNum        input:    Volume specification.                                }
  439. {    name        input:    The user or group name.                                }
  440. {    objType        input:    The mapping function code: 3 if you're mapping a    }
  441. {                        user name to a user ID or 4 if you're mapping a        }
  442. {                        group name to a group ID.                            }
  443. {    ID            output:    The user or group ID.                                }
  444.  
  445.  
  446. {***************************************************************************}
  447.  
  448.  
  449.     FUNCTION HCopyFile (srcVRefNum: Integer;
  450.                                     srcDirID: LongInt;
  451.                                     srcName: Str255;
  452.                                     dstVRefNum: Integer;
  453.                                     dstDirID: LongInt;
  454.                                     dstPathname: StringPtr;
  455.                                     copyName: StringPtr): OSErr;
  456. {    Use HCopyFile to duplicate a file and optionally to rename it.            }
  457. {    The source and destination volumes must be on the same file server.        }
  458. {                                                                            }
  459. {    srcVRefNum    input:    Source volume specification.                        }
  460. {    srcDirID    input:    Source directory ID.                                }
  461. {    srcName        input:    Source file name.                                    }
  462. {    dstVRefNum    input:    Destination volume specification.                    }
  463. {    dstDirID    input:    Destination directory ID.                            }
  464. {    dstPathname    input:    Pointer to destination directory name, or            }
  465. {                        nil when dstDirID specifies a directory.            }
  466. {    copyName    input:    Points to the new file name if the file is to be    }
  467. {                        renamed or nil if the file isn't to be renamed.        }
  468.  
  469.  
  470. {***************************************************************************}
  471.  
  472.  
  473.     FUNCTION FSpCopyFile (srcSpec: FSSpec;
  474.                                     dstSpec: FSSpec;
  475.                                     copyName: StringPtr): OSErr;
  476. {    Use FSpCopyFile to duplicate a file and optionally to rename it.        }
  477. {    The source and destination volumes must be on the same file server.        }
  478. {                                                                            }
  479. {    srcSpec        input:    An FSSpec record specifying the source file.        }
  480. {    dstSpec        input:    An FSSpec record specifying the destination            }
  481. {                        directory.                                            }
  482. {    copyName    input:    Points to the new file name if the file is to be    }
  483. {                        renamed or nil if the file isn't to be renamed.        }
  484.  
  485.  
  486. {***************************************************************************}
  487.  
  488.  
  489.     FUNCTION HMoveRename (vRefNum: Integer;
  490.                                     srcDirID: LongInt;
  491.                                     srcName: Str255;
  492.                                     dstDirID: LongInt;
  493.                                     dstpathName: StringPtr;
  494.                                     copyName: StringPtr): OSErr;
  495. {    Use HMoveRename to move a file or directory and optionally to rename    }
  496. {    it.  The source and destination locations must be on the same shared    }
  497. {    volume.                                                                    }
  498. {                                                                            }
  499. {    vRefNum        input:    Volume specification.                                }
  500. {    srcDirID    input:    Source directory ID.                                }
  501. {    srcName        input:    The source object name.                                }
  502. {    dstDirID    input:    Destination directory ID.                            }
  503. {    dstName        input:    Pointer to destination directory name, or            }
  504. {                        nil when dstDirID specifies a directory.            }
  505. {    copyName    input:    Points to the new name if the object is to be        }
  506. {                        renamed or nil if the object isn't to be renamed.    }
  507.  
  508.  
  509. {***************************************************************************}
  510.  
  511.  
  512.     FUNCTION FSpMoveRename (srcSpec: FSSpec;
  513.                                     dstSpec: FSSpec;
  514.                                     copyName: StringPtr): OSErr;
  515. {    Use FSpMoveRename to move a file or directory and optionally to            }
  516. {    rename it. The source and destination locations must be on the same        }
  517. {    shared volume.                                                            }
  518. {                                                                            }
  519. {    srcSpec        input:    An FSSpec record specifying the source object.        }
  520. {    dstSpec        input:    An FSSpec record specifying the destination            }
  521. {                        directory.                                            }
  522. {    copyName    input:    Points to the new name if the object is to be        }
  523. {                        renamed or nil if the object isn't to be renamed.    }
  524.  
  525.  
  526. {***************************************************************************}
  527.  
  528.  
  529.     FUNCTION GetVolMountInfoSize (volName: StringPtr;
  530.                                     vRefNum: Integer;
  531.                                     VAR size: Integer): OSErr;
  532. {    Use GetVolMountInfoSize to determine the how much space to allocate        }
  533. {    for a volume mounting information record.                                }
  534. {                                                                            }
  535. {    volName        input:    A pointer to the name of a mounted volume            }
  536. {                        or nil.                                                }
  537. {    vRefNum        input:    Volume specification.                                }
  538. {    size        output:    The space needed (in bytes) of the volume mounting    }
  539. {                        information record.                                    }
  540.  
  541.  
  542. {***************************************************************************}
  543.  
  544.  
  545.     FUNCTION GetVolMountInfo (volName: StringPtr;
  546.                                     vRefNum: Integer;
  547.                                     volMountInfo: Ptr): OSErr;
  548. {    Use GetVolMountInfo to retrieve a volume mounting information record    }
  549. {    containing all the information needed to mount the volume, except        }
  550. {    for passwords.                                                            }
  551. {                                                                            }
  552. {    volName            input:    A pointer to the name of a mounted volume        }
  553. {                            or nil.                                            }
  554. {    vRefNum            input:    Volume specification.                            }
  555. {    volMountInfo    output:    Points to a volume mounting information            }
  556. {                            record where the mounting information is to        }
  557. {                            be returned.                                    }
  558.  
  559.  
  560. {***************************************************************************}
  561.  
  562.  
  563.     FUNCTION VolumeMount (volMountInfo: Ptr;
  564.                                     VAR vRefNum: Integer): OSErr;
  565. {    Use VolumeMount to mount a volume using a volume mounting information    }
  566. {    record.                                                                    }
  567. {                                                                            }
  568. {    volMountInfo    inout:    Points to a volume mounting information record.    }
  569. {    vRefNum            output:    A volume reference number.                        }
  570.  
  571.  
  572. {***************************************************************************}
  573.  
  574.  
  575.     FUNCTION Share (vRefNum: Integer;
  576.                                     dirID: LongInt;
  577.                                     name: StringPtr): OSErr;
  578. {    Use Share to establish a local volume or directory as a share point.    }
  579. {                                                                            }
  580. {    vRefNum            input:    Volume specification.                            }
  581. {    dirID            input:    Directory ID.                                    }
  582. {    name            input:    Pointer to directory name, or nil if dirID        }
  583. {                            specifies the directory.                        }
  584.  
  585.  
  586. {***************************************************************************}
  587.  
  588.  
  589.     FUNCTION FSpShare (spec: FSSpec): OSErr;
  590. {    Use FSpShare to establish a local volume or directory as a share point.    }
  591. {                                                                            }
  592. {    spec    input:    An FSSpec record specifying the share point.            }
  593.  
  594.  
  595. {***************************************************************************}
  596.  
  597.  
  598.     FUNCTION Unshare (vRefNum: Integer;
  599.                                     dirID: LongInt;
  600.                                     name: StringPtr): OSErr;
  601. {    Use Unshare to remove a share point.                                    }
  602. {                                                                            }
  603. {    vRefNum            input:    Volume specification.                            }
  604. {    dirID            input:    Directory ID.                                    }
  605. {    name            input:    Pointer to directory name, or nil if dirID        }
  606. {                            specifies the directory.                        }
  607.  
  608.  
  609. {***************************************************************************}
  610.  
  611.  
  612.     FUNCTION FSpUnshare (spec: FSSpec): OSErr;
  613. {    Use FSpUnshare to remove a share point.                                    }
  614. {                                                                            }
  615. {    spec    input:    An FSSpec record specifying the share point.            }
  616.  
  617.  
  618. {***************************************************************************}
  619.  
  620.  
  621.     FUNCTION GetUGEntry (objType: Integer;
  622.                                     objName: StringPtr;
  623.                                     VAR objID: LongInt): OSErr;
  624. {    Use GetUGEntry to get a list of user or group entries from the            }
  625. {    local file server.                                                        }
  626. {                                                                            }
  627. {    objType        input:    The object type: -1 = group; 0 = user                }
  628. {    objName        input:    Points to a buffer (minimum Str31) where the user    }
  629. {                        or group name is to be returned or must be nil.        }
  630. {                output:    The user or group name.                                }
  631. {    objID        input:    O to get the first user or group. If the entry        }
  632. {                        objID last returned by GetUGEntry is passed, then    }
  633. {                        user or group whose alphabetically next in the list    }
  634. {                        of entries is returned.                                }
  635. {                output:    The user or group ID.                                }
  636.  
  637.  
  638. {***************************************************************************}
  639.  
  640. IMPLEMENTATION
  641.  
  642. END.